/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cinema.client.cinemaclient.managers;

import com.cinema.client.cinemaclient.constants.Constants;
import com.cinema.client.cinemaclient.model.Actor;
import java.util.List;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.MediaType;

/**
 *
 * @author Zsolt Szecsi
 */
public class ActorManager {

    public List<Actor> getAllActors() {
        Client client = ClientBuilder.newClient();
        WebTarget target = client.target(Constants.BASE_URL + "Actors");
        return target.request(MediaType.APPLICATION_JSON_TYPE).get(new GenericType<List<Actor>>() {
        });
    }
}
